package com.wzy.business.store.main.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.wzy.business.store.main.bean.ShopStatus

@Dao
interface ShopStatusDao {

    @Insert
    fun addShopStatus(vararg shopStatus: ShopStatus): List<Long>

    //更新，若出现冲突，则使用替换策略，还有其他策略可选
    @Update(onConflict = OnConflictStrategy.REPLACE)
    fun updateShopStatus(vararg shopStatus: ShopStatus): Int

    @Delete
    fun deleteShopStatus(vararg shopStatus: ShopStatus): Int

    @Query("SELECT * FROM shop_status where phone = :phone ")
    fun queryShopStatusByPhone(phone: String): List<ShopStatus>
}